package com.retail.lottery.colalottery.config.mq;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OrderCallbackProductConfig {
    // 交换机
    public static final String ORDER_CALLBACK_EXCHANGE = "cola.order.call.back";
    // 队列
    public static final String ORDER_CALLBACK_QUEUE = "cola.order.call.back.queue";
    // routing key
    public static final String ORDER_CALLBACK_ROUTING_KEY = "orderCallBack";
    /**
     * 声明交换机
     * @return
     */
//    @Bean("cola.order.call.back")
//    public Exchange topicExchange(){
//        return ExchangeBuilder.topicExchange(ORDER_CALLBACK_EXCHANGE).durable(true).build();
//    }
//    /**
//     * 声明队列
//     * @return
//     */
//    @Bean("cola.order.call.back.queue")
//    public Queue itemQueue(){
//        return QueueBuilder.durable(ORDER_CALLBACK_QUEUE).build();
//    }
//    /**
//     * 绑定队列和交换机
//     * @param queue
//     * @param exchange
//     * @return
//     */
//    @Bean
//    public Binding itemQueueExchange(@Qualifier("cola.order.call.back.queue") Queue queue,
//                                     @Qualifier("cola.order.call.back") Exchange exchange){
//        return BindingBuilder.bind(queue).to(exchange).with(ORDER_CALLBACK_ROUTING_KEY).noargs();
//    }
}
